package cn.edu.stu.syllabus.datas;

/**
 * Created by daidaijie on 2017/4/21.
 */

public class RequestState {

    public static final int REQUEST_FIRST = 1;
    public static final int REQUEST_SUCCESS = 2;
    public static final int REQUEST_EMPTY = 4;
    public static final int REQUEST_ERROR = 8;


    public static boolean isFirst(int requestState) {
        return (requestState & REQUEST_FIRST) == REQUEST_FIRST;
    }

    public static boolean isSuccess(int requestState) {
        return (requestState & REQUEST_SUCCESS) == REQUEST_SUCCESS;
    }

    public static boolean isEmpty(int requestState) {
        return (requestState & REQUEST_EMPTY) == REQUEST_EMPTY;
    }

    public static boolean isError(int requestState) {
        return (requestState & REQUEST_ERROR) == REQUEST_ERROR;
    }
}
